<?php

namespace app\admin\controller\common;

use app\admin\model\Duty;
use app\admin\model\Staff;
use \app\common\Common;
use app\sys\model\Dict;
use think\Request;

class ListData extends Common
{
    // 获取员工
    public function getStaffList(Request $request)
    {
        $staffType = $request->param("staff_type");
        $search= $request->param("search");
        $user = $request->_user;
        $res = Staff::staffTypeList($staffType,$search);
        return successJson("success",$res);
    }

    public function getDictList(Request $request)
    {
        $cate= $request->param("cate");
        $res = Dict::list($cate);
        return successJson("success",$res);
    }

    public static function getDutyList(Request $request)
    {
        $res = Duty::field("name as label,id as value")->select();
        return successJson("success",$res);
    }
}